<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <script>
        s = 'A man, a plan, a canal: Panama'

        var isPalindrome = function(s) {
            s = s.toLowerCase().replace(/\W/g,'')
            var start = 0
            var end = s.length-1
            while (start<end){
                if(s[start]!=s[end]){
                    return false
                }
                start++
                end--
            }
            return true
        };
        console.log(isPalindrome(s));

        for (let i=0;i<s.length;i++){
            console.log(s[i])
        }

    </script>
</body>
</html>